<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                template="/templates/template.xhtml">

    <ui:define name="title">消耗记录</ui:define>
    <ui:define name="content">
        <h:form id="incomeForm">
            <p:dialog header="操作执行中,请稍候" widgetVar="doing" modal="true" closable="false" resizable="false"
                      draggable="false"/>
            <p:defaultCommand target="search"/>
            <div class="topbar clearfix" style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="left">
                        <p:commandButton id="toggler" type="button" value="展示选择"
                                         style="width: auto;"
                                         icon="ui-icon-calculator"/>
                        <p:columnToggler datasource="statisticRecordDataTable" trigger="toggler"/>
                    </f:facet>
                    <f:facet name="right">
                        <p:commandButton value="新增" actionListener="#{xhhSettlementIncomeListBean.onAdd()}"
                                         oncomplete="PF('adding').show();" process="@this" update="@form"
                                         icon="fa fa-plus" rendered="false">
                        </p:commandButton>
                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                                         actionListener="#{xhhSettlementIncomeListBean.onSearch()}"
                                         onstart="PF('doing').show()"
                                         update="@form"/>
                        <p:commandButton value="重置" actionListener="#{xhhSettlementIncomeListBean.onReset()}"
                                         icon="fa fa-refresh"
                                         process="@this" update="@form"/>
                        <p:commandButton value="开票" actionListener="#{xhhSettlementIncomeListBean.onBill()}"
                                         icon="fa fa-refresh"
                                         process="@this statisticRecordDataTable"/>
                        <p:commandButton value="导出" icon="fa fa-download"
                                         ajax="false">
                            <p:dataExporter type="xls" target="statisticRecordDataTable" fileName="消耗记录"
                                            postProcessor="#{xhhSettlementIncomeListBean.postProcessXLS}"/>
                        </p:commandButton>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-g ui-fluid" style="padding-top: 30px;">
                <div class="ui-g-12">
                    <div class="ui-g-12 card">
                        <h1>查询条件</h1>
                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:center;">

                            <p:outputLabel value="产品名称"/>
                            <p:selectOneMenu id="productId" value="#{xhhSettlementIncomeListBean.$.productId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementIncomeListBean.productList}"
                                               var="dic"
                                               itemLabel="#{dic.productName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="主体名称"/>
                            <p:selectOneMenu id="companyId" value="#{xhhSettlementIncomeListBean.$.companyId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementIncomeListBean.companyList}"
                                               var="dic"
                                               itemLabel="#{dic.companyName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="合作模式"/>
                            <p:selectOneMenu id="copMode" value="#{xhhSettlementIncomeListBean.$.copMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_COOPERATION_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="推广方式"/>
                            <p:selectOneMenu id="spreadMode" value="#{xhhSettlementIncomeListBean.$.spreadMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_SPREAD_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="推广渠道"/>
                            <p:selectOneMenu id="spreadChannel" value="#{xhhSettlementIncomeListBean.$.spreadChannel}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_SPREAD_CHANNEL]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="结算模式"/>
                            <p:selectOneMenu id="settlementMode" value="#{xhhSettlementIncomeListBean.$.settlementMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_CYCLE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="开票状态"/>
                            <p:selectOneMenu id="billStatus" value="#{xhhSettlementIncomeListBean.$.billStatus}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItem itemLabel="未开票" itemValue="0"/>
                                <f:selectItem itemLabel="财务专员审核中" itemValue="1"/>
                                <f:selectItem itemLabel="财务经理审核中" itemValue="2"/>
                                <f:selectItem itemLabel="已开票" itemValue="3"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="结算时间"/>
                            <p:outputPanel>
                                <p:calendar
                                        id="startTime" styleClass="autoWidthCalendar"
                                        value="#{xhhSettlementIncomeListBean.$.startTime}"
                                        locale="#{constants:get('LOCALE')}"
                                        timeZone="#{constants:get('TIME_ZONE')}"
                                        pattern="#{constants:get('DATE_FORMAT')}"/>
                                <span>— </span>
                                <p:calendar
                                        id="endTime" styleClass="autoWidthCalendar"
                                        value="#{xhhSettlementIncomeListBean.$.endTime}"
                                        locale="#{constants:get('LOCALE')}"
                                        timeZone="#{constants:get('TIME_ZONE')}"
                                        pattern="#{constants:get('DATE_FORMAT')}"/>
                            </p:outputPanel>

                            <p:outputLabel value="创建人"/>
                            <p:inputText id="creator" value="#{xhhSettlementIncomeListBean.$.creator}"/>

                        </p:panelGrid>
                    </div>

                    <div class="ui-g-12 card">
                        <p:dataTable id="statisticRecordDataTable"
                                     style="width: 100%;text-align:center"
                                     var="record"
                                     value="#{xhhSettlementIncomeListBean.lazyDataModel}"
                                     rows="#{constants:get('ROWS')}"
                                     lazy="true"
                                     paginator="true"
                                     paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                     rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                     emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                     scrollable="true"
                                     scrollWidth="98%"
                                     reflow="true"
                                     selection="#{xhhSettlementIncomeListBean.selectIncomeList}" rowKey="#{record.id}"
                                     resizableColumns="true">
                            <p:column selectionMode="multiple" style="width:16px;text-align:center" exportable="false"/>

                            <p:column headerText="操作" exportable="false" style="width: 70px">
                                <p:splitButton icon="fa fa-eye"
                                               process="@this"
                                               actionListener="#{xhhSettlementIncomeListBean.onSee(record.id)}"
                                               oncomplete="PF('adding').show();" update="@form">
                                    <f:setPropertyActionListener
                                            value="/views/settlementsystem/income-list.xhtml"
                                            target="#{currentUserBean.back}"/>

                                    <p:menuitem value="删除" icon="fa fa-remove"
                                                rendered="#{security:areAllGranted('LOAN_SETTLEMENT_INCOME_DELETE')}"
                                                actionListener="#{xhhSettlementIncomeListBean.onDelete(record.id, record.billStatus)}"
                                                process="@this" update="@form">
                                        <p:confirm header="提示信息" message="是否确定删除?" icon="ui-icon-alert"/>
                                    </p:menuitem>
                                </p:splitButton>
                            </p:column>
                            <p:column headerText="开始时间" style="text-align:center;width: 70px">
                                <h:outputText value="#{record.startTime}">
                                    <f:convertDateTime pattern="#{constants:get('DATE_FORMAT')}"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="结束时间" style="text-align:center;width: 70px">
                                <h:outputText value="#{record.endTime}">
                                    <f:convertDateTime pattern="#{constants:get('DATE_FORMAT')}"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="产品名称" style="width: 100px">
                                <h:outputText value="#{record.productName}"/>
                            </p:column>
                            <p:column headerText="主体唯一id" style="width: 50px">
                                <h:outputText value="#{record.companyId}"/>
                            </p:column>
                            <p:column headerText="所属主体" style="width: 250px">
                                <h:outputText value="#{record.companyName}"/>
                            </p:column>
                            <p:column headerText="推广方式" style="text-align:center;width: 100px">
                                <h:outputText
                                        value="#{xhhSettlementIncomeListBean.translate(DictionaryCode.XHH_SETTLEMENT_SPREAD_MODE,record.spreadMode)}"/>
                            </p:column>
                            <p:column headerText="推广渠道" style="text-align:center;width: 100px">
                                <h:outputText
                                        value="#{xhhSettlementIncomeListBean.translate(DictionaryCode.XHH_SETTLEMENT_SPREAD_CHANNEL,record.spreadChannel)}"/>
                            </p:column>
                            <p:column headerText="合作模式" style="text-align:center;width: 100px">
                                <h:outputText
                                        value="#{xhhSettlementIncomeListBean.translate(DictionaryCode.XHH_COOPERATION_MODE,record.copMode)}"/>
                            </p:column>
                            <p:column headerText="结算方式" style="text-align:center;width: 100px">
                                <h:outputText
                                        value="#{xhhSettlementIncomeListBean.translate(DictionaryCode.XHH_SETTLEMENT_CYCLE,record.settlementMode)}"/>
                            </p:column>

                            <p:column headerText="结算单价(元)" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.priceCpa == null ?'-':record.priceCpa}">
                                    <f:convertNumber pattern="#,##0.00"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="结算单价(%)" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.priceCps == null?'-':record.priceCps}">
                                    <f:convertNumber pattern="#,##0.00"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="注册数" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.registerCount == null ?'-': record.registerCount}"/>
                            </p:column>
                            <p:column headerText="放款金额" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.lendAmount == null ?'-': record.lendAmount}">
                                    <f:convertNumber pattern="#,##0.00"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="点击数" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.clickCount == null ?'-': record.clickCount}"/>
                            </p:column>
                            <p:column headerText="结算金额(#{xhhSettlementIncomeListBean.rangeTotalIncomeAmount}元)"
                                      style="text-align:center;width: 100px">
                                <h:outputText value="#{record.incomeAmount}">
                                    <f:convertNumber pattern="#,##0.00"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="参与UV" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.participateUv}"/>
                            </p:column>
                            <p:column
                                    headerText="UV价值(#{xhhSettlementIncomeListBean.averageUvValue})"
                                    style="text-align:center;width: 100px">
                                <h:outputText value="#{record.uvValue}">
                                    <f:convertNumber pattern="#,##0.00"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="开票状态" style="text-align:center;width: 100px">
                                <h:outputText value="未开票" rendered="#{record.billStatus==0}" style="color: red"/>
                                <h:outputText value="财务专员审核中" rendered="#{record.billStatus==1}"
                                              style="color: olivedrab"/>
                                <h:outputText value="财务经理审核中" rendered="#{record.billStatus==2}"
                                              style="color: olivedrab"/>
                                <h:outputText value="已开票" rendered="#{record.billStatus==3}" style="color: blue"/>
                            </p:column>
                            <p:column headerText="创建人" style="text-align:center;width: 100px">
                                <h:outputText value="#{record.creator}"/>
                            </p:column>
                            <p:column headerText="创建时间" style="text-align:center;width: 150px">
                                <h:outputText value="#{record.createTime}">
                                    <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                </h:outputText>
                            </p:column>
                        </p:dataTable>
                    </div>
                </div>
            </div>
            <p:dialog header="#{xhhSettlementIncomeListBean.header}" widgetVar="adding" modal="true" closable="true"
                      resizable="true" style="position: absolute;">
                <p:outputPanel id="add-dialog">
                    <div class="ui-g-12 ui-fluid" style="width:1000px;">
                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel value="产品名称"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.productId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains">
                                <p:ajax event="change" listener="#{xhhSettlementIncomeListBean.onSelectProduct()}"
                                        process="@this" update="add-dialog"/>
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementIncomeListBean.productList}"
                                               var="dic"
                                               itemLabel="#{dic.productName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="主体名称"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.companyId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementIncomeListBean.companyList}"
                                               var="dic"
                                               itemLabel="#{dic.companyName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="合作模式"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.copMode}">
                                <p:ajax event="change" listener="#{xhhSettlementIncomeListBean.onChangeCopMode()}"
                                        process="add-dialog"
                                        update="add-dialog"/>
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_COOPERATION_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="结算模式"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.settlementMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_CYCLE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="收入类型"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.incomeType}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_INCOME_TYPE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>
                        </p:panelGrid>

                        <p:outputPanel>
                            <p:panelGrid columns="4" layout="grid"
                                         columnClasses="ui-grid-col-2,ui-grid-col-4,ui-grid-col-2,ui-grid-col-4"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;text-align:left;">
                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==2
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="结算价格(元)"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==2
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputNumber value="#{xhhSettlementIncomeListBean.settlementIncome.priceCpa}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputNumber>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="结算价格(%)"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.priceCps}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </p:inputText>
                                </p:outputPanel>
                            </p:panelGrid>
                        </p:outputPanel>

                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel value="推广方式"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.spreadMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_SPREAD_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="推广渠道"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.spreadChannel}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_SPREAD_CHANNEL]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="开始日期"/>
                            <p:calendar
                                    value="#{xhhSettlementIncomeListBean.settlementIncome.startTime}"
                                    locale="#{constants:get('LOCALE')}"
                                    timeZone="#{constants:get('TIME_ZONE')}"
                                    pattern="#{constants:get('DATE_FORMAT')}">
                                <p:ajax event="dateSelect"
                                        listener="#{xhhSettlementIncomeListBean.onChangeParticipateUv()}" process="@this"/>
                            </p:calendar>

                            <p:outputLabel value="结束日期"/>
                            <p:calendar
                                    value="#{xhhSettlementIncomeListBean.settlementIncome.endTime}"
                                    locale="#{constants:get('LOCALE')}"
                                    timeZone="#{constants:get('TIME_ZONE')}"
                                    pattern="#{constants:get('DATE_FORMAT')}">
                                <p:ajax event="dateSelect"
                                        listener="#{xhhSettlementIncomeListBean.onChangeParticipateUv()}" process="@this"/>
                            </p:calendar>
                        </p:panelGrid>

                        <p:outputPanel>
                            <p:panelGrid columns="4" layout="grid"
                                         columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;text-align:left;">
                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="注册数"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.registerCount}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputText>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="放款金额"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputNumber value="#{xhhSettlementIncomeListBean.settlementIncome.lendAmount}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputNumber>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==2}">
                                    <p:outputLabel value="点击数"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==2}">
                                    <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.clickCount}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputText>
                                </p:outputPanel>
                            </p:panelGrid>
                        </p:outputPanel>


                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel value="结算金额"/>
                            <p:inputNumber id="incomeAmount"
                                           value="#{xhhSettlementIncomeListBean.settlementIncome.incomeAmount}">
                            </p:inputNumber>
                        </p:panelGrid>

                        <p:panelGrid columns="2" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-11"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel for="selectActivity" value="关联活动"/>
                            <p:selectCheckboxMenu id="selectActivity"
                                                  value="#{xhhSettlementIncomeListBean.activityIdList}"
                                                  updateLabel="true" multiple="true" filter="true"
                                                  filterMatchMode="contains">
                                <f:selectItems value="#{xhhSettlementIncomeListBean.activityList}" var="activity"
                                               itemValue="#{activity.id}"
                                               itemLabel="#{activity.name}(#{activity.id})"/>
                            </p:selectCheckboxMenu>

                            <p:outputLabel for="selectActivity" value="备注"/>
                            <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.remark}"/>
                        </p:panelGrid>

                        <p:commandButton value="保存" style="float: right"
                                         actionListener="#{xhhSettlementIncomeListBean.onSave()}"
                                         process="@this add-dialog"/>
                    </div>
                </p:outputPanel>
            </p:dialog>
            <ui:include src="income-bill-dialog.xhtml"/>
        </h:form>
    </ui:define>
</ui:composition>